namespace EnterpriseLibraryExtensions.Events
{
    /// <summary>
    /// The EnlistedEventHandler interface is used by the aggregation scope when events are raised. The implementing class
    /// keeps track of who raised it (sender), the arguments (args) and the actual event handler that is to handle the event if it is
    /// to be raised on scope complete.
    /// </summary>
    public interface IEnlistedEventHandler
    {
        /// <summary>
        /// Gets the sender. The sender is the object instance that raised the event.
        /// This value can be null.
        /// </summary>
        /// <value>The sender.</value>
        object Sender { get; }

        /// <summary>
        /// Gets the arguments. The arguments are passed to the event handler when the event aggregation scope
        /// determines that the event handler should be invoked.
        /// </summary>
        /// <value>The args which are passed to the event handler on invokation..</value>
        object Args { get; }

        /// <summary>
        /// Gets the event handler for the event. The event handler is invoked when the event aggregation scope determines it should be called.
        /// </summary>
        /// <value>The event handler.</value>
        IHandlesEvent EventHandler { get; }
    }
}